{% extends "forum/frame.html" %}
{% load i18n %} 
{% load ytutil %}

{% block description %}
  <meta name="description" content="{{ board.title|escape }}, {% for board in sub_boards %}{{ board.title|escape }}, {% endfor %}{% for post in posts %}{{ post.title }}, {% endfor %}">
{% endblock %}

{% block content %}

  <div id="forum_nav">
  <a class="forum_link" href="{% url ytcommunity.forum.view.board.list %}">{% trans 'Homepage' %}</a>
  
  {% for board in board.get_board_path %}
  - <a class="forum_link" href="{% url ytcommunity.forum.view.board.display name=board.get_board_key %}">{{ board.title|escape }}</a>
  {% endfor %}

  {% if board and not board.dummy and auth.add %}
  - <a class="forum_link" href="{% url ytcommunity.forum.view.post.add name=board.get_board_key %}">{% trans 'Post' %}</a> 
  {% endif %}
  
  </div>

  {% if sub_boards %}
  <table class="forum" cellspacing="1">
    <thead>
      <tr>
        <td class="forum_title" style="border-left: 1px solid white;width:70%;">{% trans 'Board' %}</td>
        <td class="forum_title" style="width: 15%;">{% trans 'Post Number' %}</td>
        <td class="forum_title" style="width: 15%; border-right: 1px solid white;">{% trans 'Latest' %}</td>
      </tr>
    </thead>
    <tbody>
    
    {% for board in sub_boards %}
    <tr>
    <td class="forum_body">
      <a href="{% url ytcommunity.forum.view.board.display name=board.get_board_key %}">{{ board.title|escape }}</a>    
    </td>
    <td class="forum_body_center">{{ board.number }}</td>
    <td class="forum_body_center">
      {{ board.date|timedelta|date:"Y-m-d H:i" }}
    </td>
    </tr>
    {% endfor %}
  
    </tbody>
    
  </table>
  {% endif %}

{% if not board.dummy %}
<table class="forum" cellspacing="1">
  <thead>
    <tr>
      <td class="forum_title" style="border-left: 1px solid white;width:5%;">{% trans "Status" %}</td>
      <td class="forum_title" style="width:65%;">{{ board.title }}</td>
      <td class="forum_title" style="width: 15%;">{% trans 'Author' %}</td>
      <td class="forum_title" style="width: 15%; border-right: 1px solid white;">{% trans 'Time'%}</td>
    </tr>
  </thead>
  <tbody>
  
    {% for post in posts_stick %}
  <tr>
  <td class="forum_stick"></td>
  <td class="forum_body">
    <a href="{% url ytcommunity.forum.view.post.display id=post.key.id %}">{{ post.title|escape }}</a>    
  </td>
  <td class="forum_body_center">{{ post.author.ga }}</td>
  <td class="forum_body_center">
    {{ post.update|timedelta|date:"Y-m-d H:i" }}
  </td>
  </tr>
    {% endfor %}  
    
    {% for post in posts %}
  <tr>
  <td class="forum_status"></td>
  <td class="forum_body">
    <a href="{% url ytcommunity.forum.view.post.display id=post.key.id %}">{{ post.title|escape }}</a>    
  </td>
  <td class="forum_body_center">{{ post.author.ga }}</td>
  <td class="forum_body_center">
    {{ post.update|timedelta|date:"Y-m-d H:i" }}
  </td>
  </tr>
    {% endfor %}

  </tbody>
  
</table>
{% endif %}
  
  {% include "forum/div_pagination.html" %}
  
{% endblock %}
